package com.umeng.analytics.pro;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

class v {
    v() {

    }

    public static boolean a(String arg4, SQLiteDatabase arg5) {
        Cursor v1 = null;
        boolean v0 = false;
        if (arg4 != null) {
            try {
                v1 = arg5.rawQuery("select count(*) as c from sqlite_master where type =\'table\' and name =\'" + arg4.trim() + "\' ", null);
                if (v1.moveToNext()) {
                    if (v1.getInt(0) <= 0) {

                    } else {
                        v0 = true;
                    }
                }
            } catch (Exception v2) {
            } finally {
                if (v1 != null) {
                    try {
                        v1.close();
                    } catch (Exception e) {
                    }
                }
            }
        }
        return v0;
    }

    public static String a(Context arg2) {
        return "/data/data/" + arg2.getPackageName() + "/databases/.ua/";
    }

    public static String a(List arg1) {
        return TextUtils.join("!", ((Iterable) arg1));
    }

    public static List a(String arg2) {
        return new ArrayList(Arrays.asList(arg2.split("!")));
    }

    public static List b(List arg4) {
        ArrayList v1 = new ArrayList();
        try {
            Iterator v2 = arg4.iterator();
            while (v2.hasNext()) {
                Object v0_1 = v2.next();
                if (Collections.frequency(((Collection) v1), v0_1) > 0) {
                    continue;
                }

                ((List) v1).add(v0_1);
            }
        } catch (Exception v0) {
            v0.printStackTrace();
        }

        return ((List) v1);
    }
}

